<!DOCTYPE html>
<html>
<head>
    {include file="public/header" /}
</head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">

        <table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>

        <script type="text/html" id="currentTableBar">
            <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">编辑</a>
        </script>

    </div>
</div>
{include file="public/footer" /}
<!--性别-->
<!--<script type="text/html" id="sexTpl">-->
<!--{{#  if(d.status === 1){ }}-->
<!--<span style="color: #F581B1;"> 运行中</span>-->
<!--{{#  } else { }}-->
<!--<span>已下架</span>-->
<!--{{#  } }}-->
<!--</script>-->


<script>
    layui.use(['form', 'table'], function () {
        var $ = layui.jquery,
            table = layui.table;

        table.render({
            elem: '#currentTableId',
            url: '/admin/Industry/Levels?action=ajax',
            method: 'post',
            toolbar: '#toolbarDemo',
            defaultToolbar: ['filter',],
            cols: [[
                // {type: "checkbox",},
                {field: 'title', title: '名称'},
                {field: 'match_min', title: '起始数值'},
                {field: 'match_max', title: '结束数值'},
                {field: 'trade_num', title: '交易次数'},
                {field: 'team_people', title: '团队内人数'},
                {field: 'share_num', title: '直推人数'},
                {field: 'integral', title: '所需积分'},
                {field: 'consumption_amount', title: '消费金额'},
                {field: 'recharge_times', title: '金币充值次数'},
                {field: 'goldfinish', title: '完成任务需金币/人'},
                {title: '操作', toolbar: '#currentTableBar', minWidth: 120}
            ]],
            limits: [12],
            limit: 12,
            page: false,
            skin: 'line'
        });


        table.on('tool(currentTableFilter)', function (obj) {
            var data = obj.data;

            if (obj.event === 'edit') {

                var index = layer.open({
                    title: '编辑 升级参数',
                    type: 2,
                    shade: 0.2,
                    maxmin: true,
                    shadeClose: true,
                    area: ['100%', '100%'],
                    content: '/admin/Industry/Savelevels?id=' + obj.data.id,
                });
                $(window).on("resize", function () {
                    layer.full(index);
                });
                return false;
            }
        });

    });
</script>

</body>
</html>